﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MailServer {
    public partial class FCorreo : Form {
        private Client.Client client;
        public FCorreo(Client.Client client) {
            InitializeComponent();
            this.client = client;
        }

        private void btSend_Click(object sender, EventArgs e) {
            if(string.IsNullOrEmpty(txTo.Text)) {
                MessageBox.Show("Especifique un destinatario", "Correo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            client.SendMessage(txTo.Text, txSubject.Text, txBody.Text);
            this.Close();
        }

        private void btCancel_Click(object sender, EventArgs e) {
            Close();
        }

    }
}
